<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.28.
   家居商家装修视频控制器($$)*/

!defined('Q_PATH') && exit;

class JiajuvideoController extends AController{

	public function filter_(&$arrMap){
		$arrMap['A.jiajuvideo_title']=array('like',"%".Q::G('jiajuvideo_title')."%");
		$arrMap['A.jiajuvideo_description']=array('like',"%".Q::G('jiajuvideo_description')."%");
		$arrMap['A.jiajuvideo_viewnum']=array('egt',intval(Q::G('jiajuvideo_viewnum')));
		
		// 添加时间
		$this->getTime_('A.create_dateline',$arrMap);

		// 待审
		$this->getAudit_('A.jiajuvideo_status',$arrMap);
	}

	public function index($sModel=null,$bDisplay=true){
		parent::index('jiajuvideo',false);
		$this->display(Admin_Extend::template('jiaju','jiajuvideo/index'));
	}

	protected function sqljoin_(){
		return "->join('".Q::C('DB_PREFIX')."jiajucompany AS C','C.jiajucompany_id,C.jiajucompany_fullname,C.jiajucompany_isfvip,C.jiajucompany_domain','A.jiajucompany_id=C.jiajucompany_id')";
	}

	public function add(){
		$this->display(Admin_Extend::template('jiaju','jiajuvideo/add'));
	}

	public function edit($sMode=null,$nId=null,$bDidplay=true){
		$nId=intval(Q::G('value','G'));
		parent::edit('jiajuvideo',$nId,false);
		$this->display(Admin_Extend::template('jiaju','jiajuvideo/add'));
	}

	public function insert($sModel=null,$nId=null){
		$nId=Q::G('value');
		parent::insert('jiajuvideo',$nId);
	}

	public function update($sModel=null,$nId=null){
		$nId=Q::G('value');
		parent::update('jiajuvideo',$nId);
	}

	public function forbid($sModel=null,$sId=null,$bApp=false){
		$nId=intval(Q::G('value','G'));
		parent::forbid('jiajuvideo',$nId,true);
	}

	public function resume($sModel=null,$sId=null,$bApp=false){
		$nId=intval(Q::G('value','G'));
		parent::resume('jiajuvideo',$nId,true);
	}

	public function clear_recycle($sModel=null,$sField='status'){
		parent::clear_recycle('jiajuvideo',$sField);
	}

	public function foreverdelete_deep($sModel=null,$sId=null){
		$sId=Q::G('value');
		parent::foreverdelete_deep('jiajuvideo',$sId);
	}

	public function foreverdelete($sModel=null,$sId=null,$bApp=false){
		$sId=Q::G('value');
		parent::foreverdelete('jiajuvideo',$sId,true);
	}

	public function view_preview($sMode=null,$nId=null,$bDidplay=true){
		$nId=intval(Q::G('value','G'));
		parent::view_preview('jiajuvideo',$nId,false);
		$this->display(Admin_Extend::template('jiaju','jiajuvideo/viewpreview'));
	}

	public function save_preview($sMode=null,$nId=null){
		$nId=intval(Q::G('value','G'));
		parent::save_preview('jiajuvideo',$nId);
	}

	public function save_previewstatus($sMode=null,$nId=null){
		$nId=intval(Q::G('value','G'));
		parent::save_previewstatus('jiajuvideo',$nId);
	}

}
